import request from '../utils/request'
import token from '../utils/token'

export default {
  auth () {
    return token.get()
  },
  user () {
    const tk = token.get()
    if (tk) {
      return request.get('/api/login')
    } else {
      return null
    }
  },
  flush () {
    token.remove()
  }
}
